package com.vvlive.caibao.smartcity.adapter;

import android.content.Context;
import android.widget.TextView;

import com.vvlive.caibao.smartcity.base.SuperAdapter;
import com.vvlive.caibao.smartcity.bean.MeetingByMonth;
import com.vvlive.caibao.smartcity.bean.PersonalMeetingBean;
import com.vvlive.caibao.smartcity.utils.MeetingsController;

import java.util.List;

import smartcity.vvlive.caibao.com.smartc.R;

/**
 * Created by zhj on 2015/10/15.
 */
public class MeetingsAdapter extends SuperAdapter<MeetingByMonth> {

    public MeetingsAdapter(Context context, List<MeetingByMonth> dataList) {
        super(context, R.layout.item_personal_meeting_list, dataList);
    }

    @Override
    public void onBindData(ViewHolder viewHolder, MeetingByMonth bean, int position) {
        TextView theme = viewHolder.get(R.id.p_meeting_theme);
        TextView address = viewHolder.get(R.id.p_meeting_address);
        TextView time = viewHolder.get(R.id.p_meeting_time);
        theme.setText("主题：" + bean.getTopic());
        address.setText("地点：" + bean.getRoom());
        String timeStr = bean.getTime();
        String finalTime = MeetingsController.getStartDateTime(timeStr) + " ~ " + MeetingsController.getEndDateTime(timeStr);
        time.setText("时间：" + finalTime);
    }
}
